package io.renren.controller;

import io.renren.common.utils.R;
import io.renren.service.AdService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 广告模块
 *
 * @author huolikang
 */
@RestController
@RequestMapping("api/ad")
public class ApiAdController {
    @Autowired
    private AdService adService;

    /***
     * 获取广告
     * @param adPositionId 广告位置
     * @return R
     */
    @RequestMapping("getAd")
    @ApiOperation("获取广告")
    public R getAd(@RequestParam("adPositionId") Integer adPositionId) {
        return adService.getAd(adPositionId);
    }

}
